#ifndef CHATBOX_H
#define CHATBOX_H

#include <QListWidget>
#include <QObject>
#include <QWidget>
#include "./widgets/mainWindow/subWidgets/chatView/chatmessage/chatmessagebubble.h"

class ChatBox : public QListWidget
{
    Q_OBJECT
public:
    explicit ChatBox(QWidget *parent = nullptr);
    void insertNewChatMessage(QString text, QString time, bool isSend);
    void refreshUI(void);

private:
    void dealMessage(ChatMessageBubble* chatMessageBox, QListWidgetItem* item, QString text,
                     QString time,  ChatMessageBubble::User_Type type);
    void dealMessageTime(QString curMsgTime);

protected:
    void resizeEvent(QResizeEvent *event) override;
};

#endif // CHATBOX_H
